package arithmetic2.day04;

import java.util.TreeMap;

/*
    有序表的使用:
        TreeMap、TreeSet
 */
public class Demo01 {
    public static void main(String[] args) {
        TreeMap<Node,String> map = new TreeMap<>();
        map.put(new Node(1),"a");
        map.put(new Node(2),"b");
        map.put(new Node(3),"c");
        map.put(new Node(4),"d");

    }
}

class Node implements  Comparable<Node>{
    int value;

    public Node(int value) {
        this.value = value;
    }

    @Override
    public int compareTo(Node o) {
        return this.value - o.value;
    }
}
